import 'package:package_info/package_info.dart';

export 'package:package_info/package_info.dart';

class AppUtil
{
  static AppUtil _appUtil;
  PackageInfo packageInfo;

  static AppUtil share(){
    if(_appUtil == null){
      _appUtil = AppUtil();
    }
    return _appUtil;
  }

  static String appInfo(Function(PackageInfo packageInfo) complete){

    PackageInfo.fromPlatform().then((PackageInfo packageInfo) {
      /*
      String appName = packageInfo.appName;
      String packageName = packageInfo.packageName;
      String version = packageInfo.version;
      String buildNumber = packageInfo.buildNumber;

      AppUtil.share().packageInfo = packageInfo;
      */
      complete(packageInfo);
    });
  }
}